//
//  SetViewController.m
//  penzer
//
//  Created by caiyc on 2018/10/4.
//  Copyright © 2018年 caiyc. All rights reserved.
//

#import "SetViewController.h"
#import "PersonInfoViewController.h"
#import "ChangeRoleViewController.h"
#import "HostAuthViewController.h"
@interface SetViewController ()

@end

@implementation SetViewController
- (IBAction)func_Action:(UIButton *)sender {
    NSInteger index = sender.tag;
    if(index==0){
        //个人资料
        PersonInfoViewController *vc = [[PersonInfoViewController alloc]init];
        [self pushSecondVC:vc];
    }else if (index==1){
        HostAuthViewController *vc = [[HostAuthViewController alloc]init];
        [self pushSecondVC:vc];
    }else{
        ChangeRoleViewController *vc = [[ChangeRoleViewController alloc]init];
        [self pushSecondVC:vc];
    }
}
-(void)viewWillAppear:(BOOL)animated{
    [self setViews];
}
- (void)viewDidLoad {
    [super viewDidLoad];
     [self setNavigation:1 andTitle:@"设置" andNaviColor:[UIColor whiteColor] andTitleColor:nil];
    
    // Do any additional setup after loading the view from its nib.
}
-(void)setViews{
    NSDictionary *userDic = [XTool GetDefaultInfo:HOST_USER];
    NSString *nickString = userDic[@"nickname"];
    self.nick.text = userDic[@"nickname"];
    //avatar
    NSURL *url = [NSURL URLWithString:userDic[@"avatar"]];
    [self.icon sd_setImageWithURL:url];
    self.icon.layer.cornerRadius = 45;
    self.icon.layer.masksToBounds = 1;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
